package com.pswv2.util.Clock;

/*import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;*/
import com.pswv2.util.MusicUtil;

public class AlarmClock
{
    /*private final Scheduler scheduler = new Scheduler();

    private final int year,mounth,day,hourofDay, minute, second;
    
    private final String termini,work;

    public AlarmClock(int year,int mounth,int day,int hourOfDay, int minute, int second,String termini,String work)
    {	
    	this.year = year;
        this.mounth = mounth;
        this.day = day;
        this.hourofDay = hourOfDay;
        this.minute = minute;
        this.second = second;
        this.termini = termini;
        this.work = work;
    }


    public void start()
    {
        scheduler.schedule(new SchedulerTask()
        {
            public void run()
            {
                String position = "烟把儿乐队 - 纸短情长 (铃声).mp3";
        		MusicUtil m=new MusicUtil();
        		m.getDuration(position);
        		m.play(position);
        		System.out.println(termini+work+"++++++++++++++++++++++");
        		ActiveXComponent sap = new ActiveXComponent("Sapi.SpVoice");
      		  
    		    Dispatch sapo = sap.getObject();
    		    try {

    		        // 音量 0-100
    		        sap.setProperty("Volume", new Variant(100));
    		        // 语音朗读速度 -10 到 +10
    		        sap.setProperty("Rate", new Variant(-1));


					// 执行朗读
    		        Dispatch.call(sapo, "Speak", new Variant(termini+work));

    		    } catch (Exception e) {
    		        e.printStackTrace();
    		    } finally {
    		        sapo.safeRelease();
    		        sap.safeRelease();
    		    }
            }
        }, new DailyIterator(year,mounth,day,hourofDay, minute, second));
    }


    public static void main(String[] args)
    {
    	AlarmClock alarmClock = new AlarmClock(2018, 9, 5, 17, 19, 10,"","");
        alarmClock.start();
    	ActiveXComponent sap = new ActiveXComponent("Sapi.SpVoice");
		  
	    Dispatch sapo = sap.getObject();
    	try {

	        // 音量 0-100
	        sap.setProperty("Volume", new Variant(100));
	        // 语音朗读速度 -10 到 +10
	        sap.setProperty("Rate", new Variant(-1));


			// 执行朗读
	        Dispatch.call(sapo, "Speak", new Variant("我打的拉丁化禁卡局和杀手的话"));

	    } catch (Exception e) {
	        e.printStackTrace();
	    } finally {
	        sapo.safeRelease();
	        sap.safeRelease();
	    }
    }*/
}


